import { request } from '@/utils'

interface RobotQueryParams {
  RType?: string
  pageNum?: number
  pageSize?: number
  [key: string]: any
}

interface AlignPositionData {
  [key: string]: any
}

export const archives = {
  getRobotAndCompany(params: RobotQueryParams) {
    return request({
      url: '/robot-archives/v1/getRobotAndCompany',
      method: 'get',
      params
    })
  }
}

export function robotAlignPosition(data: AlignPositionData) {
  return request({
    url: '/robot-cruise/calibrationV2',
    method: 'post',
    data
  })
}

export function robotFaultInfo(code: string | number) {
  return request({
    url: '/robot-inspection-log/v1/faultInfo/' + code,
    method: 'get'
  })
}

export function realTimeLocation(tid: string | number, code: string | number) {
  return request({
    url: `/robot-log/v1/realTimeLocation/${tid}/${code}`,
    method: 'get'
  })
}

/**
 * @description: 获取室内安保机器人
 * @param {RobotQueryParams} params
 * @return {*}
 */
export function getInsideRobot(params: RobotQueryParams) {
  return request({
    url: '/robot-archives/v1/getRobotAndCompany',
    method: 'get',
    params: {
      RType: 'inspection',
      ...params
    }
  })
}
